package com.lawyer.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.lawyer.service.FileUpLoadService;

@RestController
@RequestMapping(value = "/upload")
@Api(tags = "上传文件")
@SuppressWarnings("all")
public class FileUploadController {

	@Autowired
	FileUpLoadService fileUpLoadService;

	@RequestMapping(value = "/image", method = RequestMethod.POST)
	@ApiOperation(httpMethod = "POST", value = "上传文件", notes = "上传文件")
	public HttpEntity<?> header(@RequestParam("file") MultipartFile file) {
		return new ResponseEntity<>(fileUpLoadService.Upload(file), HttpStatus.OK);
	}

}
